package com.wanma.recuit.service.impl;

import com.github.pagehelper.PageInfo;
import com.wanma.recuit.mapper.*;
import com.wanma.recuit.pojo.*;
import com.wanma.recuit.service.AddCompanyInfoService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class AddCompanyInfoServiceImpl implements AddCompanyInfoService {

    @Resource
    private CityMapper cityMapper;
    @Resource
    private IndustryMapper industryMapper;
    @Resource
    private DictionaryMapper dictionaryMapper;
    @Resource
    private CompanyMapper companyMapper;
    @Resource
    private CheckMapper checkMapper;
    @Resource
    private CompanyUserMapper companyUserMapper;

    @Override
    public void insert(City object) {

    }

    @Override
    public void delete(Integer id) {

    }

    @Override
    public void delete(String ids) {

    }

    @Override
    public void update(City object) {

    }

    @Override
    public City findById(Integer id) {
        return null;
    }

    @Override
    public List<City> findAll() {
        return null;
    }

    @Override
    public PageInfo<City> findPage(int pageNum, int pageSize) {
        return null;
    }
    //查询省份及其城市
    public  List<City> findProcinceCities(){
        return cityMapper.findProcinceCities();
    }
    //查询行业的一级分类
    public List<Industry> findIndustrys(){
        return  industryMapper.findIndustrys();
    }
    //查询城市
    public List<City> findCities(Integer id) { return cityMapper.findCities(id); }
    //查询公司的规模
    public List<Dictionary> findCompanyScale(){return dictionaryMapper.findCompanyScale();};
    //向数据库添加公司的第一页信息 以及提交的状态标志
    public int insertOneCompanyInfo( Company company){ return  companyMapper.insertOneCompanyInfo(company); }
    //向数据库更新信息，改变第二页对应的提交状态
    public  int updateTwoCheckIofo(Company company){return companyMapper.updateTwoCheckIofo(company);}
    //向审核表添加一条提交记录
    public  int submitCheck(CompanyUser companyUser){return checkMapper.submitCheck(companyUser);}
    //修改提交失败要返回页面的状态，要修改两个状态一个是第二页一个是第三页
    public  int  updateTwoThree(Company company){return companyMapper.updateTwoThree(company);}
    //将公司的id放到公司所有者的表中
    public void  putCompanyId(CompanyUser companyUser){companyUserMapper.putCompanyId(companyUser);};

}
